print portal: Plug a memory leak
authorMatthias Clasen <mclasen@redhat.com>
Wed, 15 Aug 2018 23:13:15 +0000 (23:13 +0000)
committerMatthias Clasen <mclasen@redhat.com>
Wed, 15 Aug 2018 23:13:15 +0000 (23:13 +0000)
Pointed out by Christian Persch.

Closes https://gitlab.gnome.org/GNOME/gtk/issues/1271

gtk/gtkprintoperation-portal.c

index 43e6079be654bd3bde3d98ae4ce53253af60eab6..a6683fd212ae4f477694777e4ed6feb0ada39e9c 100644 (file)
@@ -378,7 +378,7 @@ prepare_print_response (GDBusConnection *connection,
 {
   PortalData *portal = data;
   guint32 response;
-  GVariant *options;
+  GVariant *options = NULL;
 
   if (portal->response_signal_id != 0)
     {
@@ -427,6 +427,9 @@ prepare_print_response (GDBusConnection *connection,
   else
     portal->result = GTK_PRINT_OPERATION_RESULT_CANCEL;
 
+  if (options)
+    g_variant_unref (options);
+
   if (portal->loop)
     g_main_loop_quit (portal->loop);
 }